package com.songlanyun.modules.account.controller.admin;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.songlanyun.common.utils.Constant;
import com.songlanyun.common.utils.R;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.account.service.UserVerifiedService;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;

/**
 * 实名认证
 *
 * @author lijiahe
 * @date 2022-09-22
 */
@RestController
@RequestMapping("admin/account/verified")
public class UserVerifiedController extends AbstractApiController {

    @Autowired
    private UserVerifiedService userVerifiedService;

    /**
     * 分页
     */
    @GetMapping("/page")
    @ApiImplicitParams({
        @ApiImplicitParam(name = Constant.PAGE, value = "当前页码，从1开始", paramType = "query", required = true, dataType = "int"),
        @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
        @ApiImplicitParam(name = "realName", value = "真实姓名", paramType = "query", dataType = "String"),
        @ApiImplicitParam(name = "identityNumber", value = "身份证卡号", paramType = "query", dataType = "String"),})
    public R page(@RequestParam Map<String, Object> params) {
        return R.ok().put("page", userVerifiedService.queryPage(params));
    }

    /**
     * 详情
     */
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") Long id) {
        return R.ok().put("data", userVerifiedService.info(id));
    }

}
